//
//  CZHomeTitleButton.swift
//  weibo
//
//  Created by Mac on 16/5/20.
//  Copyright © 2016年 fengzhixiang. All rights reserved.
//

import UIKit

class CZHomeTitleButton: UIButton {

    override func layoutSubviews() {
        //创建按钮要记得调用父类方法
        super.layoutSubviews()

        //1.将文字的frame.orgin.x = 0  
        titleLabel?.frame.origin.x = 0

        //2.将图片的frame.origin.x设置为文字的宽度
        imageView?.frame.origin.x = titleLabel!.frame.width + 3

    }

}
